import  threading
import time

class MyThread(threading.Thread) :
    def run(self):
        for i in range(3):
            time.sleep(1)
            msg = "I'm "+self.name+' @ '+str(i) #name属性中保存的是当前线程的名字
            print(msg)

if __name__ == "__main__":
    t = MyThread()
    t.start()

    # time.sleep(5)
    print("end") # 注掉上行代码，执行完t.start()马上打印


if (__name__ == "__main__"):
    print("main end") # 去掉time.sleep(5)，接着print("end")打印

